<?php
class ProductModel extends RelationModel{

	public $_link = array(
		'ProductSpec'=>array(
			'mapping_type'  =>HAS_MANY, 
		    'class_name'  =>'ProductSpec',
		    'mapping_name' => 'ProductSpecs',
		    'foreign_key' => 'product_id'),

		'Category'=>array(
				'mapping_type'  =>MANY_TO_MANY, 
			    'class_name'  =>'Category',
				'foreign_key'=>'product_id',
				'relation_foreign_key'=>'category_id',
		    	'mapping_name' => 'Categories',
				'relation_table' => 't_product_category_mapping'),

	);

	public $_auto		=	array(
	array('create_time','get_client_time',self::MODEL_INSERT,'function'),
	array('update_time','get_client_time',self::MODEL_BOTH,'function'),
	);
}


?>